package insultGen.systemFiles;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioGroup;

public class InsultOptions extends Activity{

	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.options);
        
        final RadioGroup raceButton = (RadioGroup) findViewById(R.id.race);
        
        Button fin = (Button) findViewById(R.id.finish);
        fin.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				setRace(raceButton);
				finish();
			}
		});
	}
	public void setRace(RadioGroup rg){
		if(rg.getCheckedRadioButtonId() == R.id.none){
			Options.setRace(0);
		}else if(rg.getCheckedRadioButtonId() == R.id.black){
			Options.setRace(1);
		}else if(rg.getCheckedRadioButtonId() == R.id.mexican){
			Options.setRace(2);
		}else if(rg.getCheckedRadioButtonId() == R.id.asian){
			Options.setRace(3);
		}
	}
	
}
